package com.eastfair.certificate.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperCacheService;
import com.eastfair.boot.service.SuperService;
import com.eastfair.certificate.dto.CertificateDTO;
import com.eastfair.certificate.entity.Certificate;
import com.eastfair.certificate.vo.CertificateVO;
import com.eastfair.core.base.R;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * <p>
 * 业务接口
 * 证件设置
 * </p>
 *
 * @author ligang
 * @date 2022-07-22
 */
public interface CertificateService extends SuperCacheService<Certificate> {


    /**
     * 添加证件
     *
     * @param certificateDTO
     * @return
     */
    R<CertificateVO> saveCertificate(@RequestBody CertificateDTO certificateDTO);


    /**
     * do转vo
     *
     * @param model
     */
    CertificateVO doToVo(Certificate model);

    /**
     * do转vo
     *
     * @param modelList
     */
    List<CertificateVO> doToVos(List<Certificate> modelList);


    /**
     * 通用查询
     *
     * @param modelDTO DTO
     * @param ids      主键id集合
     * @return list
     */
    List<Certificate> list(CertificateDTO modelDTO, List<Long> ids);

    /**
     * 通用查询
     *
     * @param modelDTO DTO
     * @param ids      主键id集合
     * @return list
     */
    List<Certificate> listOfCache(CertificateDTO modelDTO, List<Long> ids);

    /**
     * 分页查询
     *
     * @param params
     * @return
     */
    IPage<CertificateVO> pageCertificate(PageParams<CertificateDTO> params);
}
